<?php
// no direct access
defined('_JEXEC') or die;

JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');

$user		= JFactory::getUser();
$userId		= $user->get('id');
$listOrder	= $this->escape($this->state->get('list.ordering'));
$listDirn	= $this->escape($this->state->get('list.direction'));

?>
<form
	action="<?php echo JRoute::_('index.php?option=com_appcategorys&view=appcategorys');?>"
	method="post" name="adminForm" id="adminForm">
	<div class="clr"></div>

	<table class="adminlist">
		<thead>
			<tr>
				<th width="1%"><input type="checkbox" name="checkall-toggle"
					value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>"
					onclick="Joomla.checkAll(this)" />
				</th>
				<th><?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.names', $listDirn, $listOrder); ?>
				</th>
				<!-- <th width="5%"><?php echo JHtml::_('grid.sort', 'JSTATUS', 'true', $listDirn, $listOrder); ?>
				</th> -->
				<th width="10%"><?php echo JHtml::_('grid.sort', 'IsDeleted', a.is_delete, $listDirn, $listOrder); ?>
				</th>
				<th width="1%" class="nowrap"><?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
				</th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="3"><?php echo $this->pagination->getListFooter(); ?>
				</td>
			</tr>
		</tfoot>
		<tbody>
			<?php
		
		//	$canCreate	= $user->authorise('core.create',		'com_appcategorys.appcategory.'.$item->catid);
			$canEdit	= $user->authorise('core.edit',			'com_appcategorys.appcategory.'.$item->id);
			$canCheckin	= $user->authorise('core.manage',		'com_checkin');
			$canEditOwn	= $user->authorise('core.edit.own',		'com_appcategorys.appcategory.'.$item->id);
			$canChange	= $user->authorise('core.edit.state',	'com_appcategorys.appcategory.'.$item->id) && $canCheckin;
			?>
			<?php foreach ($this->items as $i => $item) :
			$item->max_ordering = 0; //??
			?>
			<tr class="row<?php echo $i % 2; ?>">
				<td class="center"><?php echo JHtml::_('grid.id', $i, $item->id); ?>
				</td>
				<td><?php if ($canEdit || $canEditOwn) : ?> <a
					href="<?php echo JRoute::_('index.php?option=com_appcategorys&task=appcategory.edit&id='.$item->id);?>">
						<?php echo $this->escape($item->name); ?>
				</a> <?php else : ?> <?php echo $this->escape($item->name); ?> <?php endif; ?>

				</td>
				<!-- <td class="center"><?php echo JHtml::_('jgrid.published', 1, $i, 'appcategorys.', $canChange, 'cb'); ?>
				</td> -->
				<td class="center"><?php 
					
				echo JHtml::_('jgrid.published', !($item->is_delete), $i, 'appcategorys.',$canChange, 'cb');
				?></td>


				<td class="center"><?php echo (int) $item->id; ?>
				</td>
			</tr>
			<?php endforeach; ?>
		</tbody>
	</table>


	<div>
		<input type="hidden" name="task" value="" /> <input type="hidden"
			name="boxchecked" value="0" /> <input type="hidden"
			name="filter_order" value="<?php echo $listOrder; ?>" /> <input
			type="hidden" name="filter_order_Dir"
			value="<?php echo $listDirn; ?>" />
		<?php echo JHtml::_('form.token'); ?>
	</div>
</form>
